package com.ruoyi.businessOrder.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 交易订单信息对象 wdmf_business_order
 *
 * @author ruoyi
 * @date 2025-07-05
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class BusinessOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID */
    @Getter
    @Setter
    private Long orderId;

    /** 关联员工ID */
    @Getter
    @Setter
    @Excel(name = "关联员工ID")
    private Long employeeId;

    /** 关联机构ID */
    @Getter
    @Setter
    @Excel(name = "关联机构ID")
    private Long organizationId;

    /** 交易金额 */
    @Excel(name = "交易金额")
    private BigDecimal amount;

    /** 业务名称 */
    @Excel(name = "业务名称")
    private String businessName;

    /** 订单提交时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "订单提交时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date submitTime;

    /** 订单状态（0=待支付 1=已支付 2=已取消 3=退款中 4=已退款）' */
    @Excel(name = "订单状态", readConverterExp = "0=待支付,1=已支付,2=已取消,3=退款中,4=已退款")
    private String orderStatus;

    /** 状态（0正常 1禁用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=禁用")
    private String status;

    /** 删除标志（0存在 2删除） */
    private String delFlag;

    /** 版本号（乐观锁） */
    @Excel(name = "版本号", readConverterExp = "乐=观锁")
    private Long version;

    /** 订单编号 */
    @Excel(name = "订单编号")
    private String orderCode;

    /** 员工姓名（快照） */
    @Excel(name = "员工姓名", readConverterExp = "快=照")
    private String name;

    /** 联系电话（快照） */
    @Excel(name = "联系电话", readConverterExp = "快=照")
    private String phone;

    /** 机构名称（快照） */
    @Excel(name = "机构名称", readConverterExp = "快=照")
    private String orgName;

    /** 员工工号（快照） */
    @Excel(name = "员工工号", readConverterExp = "快=照")
    private String jobCode;

    /** 支付类型（0=微信 1=支付宝） */
    @Excel(name = "支付类型", readConverterExp = "0==微信,1==支付宝")
    private String payType;

    /** 支付状态（0=待支付 1=已支付 2=支付失败）*/
    @Excel(name = "支付状态", readConverterExp = "0=待支付,1=已支付,2=支付失败")
    private String payStatus;

    /** 用户ID */
    private Long userId;

    /** 商品id */
    @Excel(name = "商品id")
    private Long skuId;

    /** 二维码参数 */
    @Excel(name = "二维码参数")
    private String qrCodeParams;

    /** 退款信息id */
//    @Excel(name = "退款信息id")
//    private Long refundId;

    /** 超时时间 */
    @Excel(name = "超时时间")
    private Date expireTime;

    /** 微信交易订单号 */
    @Excel(name = "微信交易订单号")
    private String transactionId;

    /** 微信预交易订单号 */
    @Excel(name = "微信预交易订单号")
    private String prepayId;

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("employeeId", getEmployeeId())
                .append("organizationId", getOrganizationId())
                .append("amount", getAmount())
                .append("businessName", getBusinessName())
                .append("submitTime", getSubmitTime())
                .append("orderStatus", getOrderStatus())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("version", getVersion())
                .append("updateTime", getUpdateTime())
                .append("createBy", getCreateBy())
                .append("updateBy", getUpdateBy())
                .append("remark", getRemark())
                .append("orderCode", getOrderCode())
                .append("name", getName())
                .append("phone", getPhone())
                .append("orgName", getOrgName())
                .append("jobCode", getJobCode())
                .append("payType", getPayType())
                .append("payStatus", getPayStatus())
                .append("userId", getUserId())
                .append("skuId", getSkuId())
                .append("qrCodeParams", getQrCodeParams())
//                .append("refundId", getRefundId())
                .append("expireTime", getExpireTime())
                .append("transactionId", getTransactionId())
                .append("prepayId", getPrepayId())
                .toString();
    }
}
